﻿{* 
    This file is a template part of Menu
    Copyright (c) 2011, xBLOKS Progect 
*}
<link rel="stylesheet" href="{$BACKEND_CSS}dataTable.css"  rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="{$BACKEND_CSS}Form.css"  rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="{$BACKEND_CSS}Buttons.css"  rel="stylesheet" type="text/css" />
<link rel="stylesheet" href='{$BACKEND_CSS}osx.css'       type="text/css" media='screen' />
<script type="text/javascript" src="{$BACKEND_JS}sliding.form.js"></script>
<script type="text/javascript" src="{$BACKEND_JS}menuControl.js"></script>

<script type="text/javascript" src="{$EXTERNAL_JS}jquery/simplemodal/jquery.simplemodal.js"       ></script> 
<script type="text/javascript" src="{$EXTERNAL_JS}jquery/simplemodal/osx.js"       ></script>


<div  class="clear"> </div>
        <div id="Fcontent">
            <div id="wrapper">
            
                <div id="steps">
                   
                        <fieldset class="step">
                        <form>
                            <legend>
                                {$lang.block_title}
                            </legend>
                            
                            <div id="tableHolder">
                                <div id="tableActions">
                                <form>
                                    <div id="search" style="width: 391px;">
                                    <form name="search_form" action="{$form_action}" method="get">
                                  
                                        <table>
                                        <thead>
                                            <tr>
                                                <th><input name="search" type="text" value="{$search}" /></th>
                                                <th width="75px"><a style="width:75px;" id="insert" class="medium green button" >{$lang.insert}</a> </th>
                                                <th width="75px"><a href="{$back_link}" style="width:75px;" id="insert" class="medium blue  button" >{$lang.back}</a> </th>
                                            </tr>
                                            </thead>
                                        </table>
                                    </form>
                                    </div>
                                    
                                    <div id="pages">
                                        <table>
                                        <thead>
                                            <tr>
                                                <th>{$lang.page}&nbsp;</th>
                                                <th style="padding-right:10px; padding-left:5px; ">
                                                    <form action="{$form_action}" name="listing" method="get">
                                                        <select onchange="this.form.submit();" name="page" style="width:50px;">
                                                            {section name=pages start=1 loop=$pages_count+1 step=1}
                                                                <option  {if $page == $smarty.section.pages.index} selected="true" {/if} value="{$smarty.section.pages.index}">{$smarty.section.pages.index}</option>                                           
                                                            {/section}
                                                        </select>
                                                    </form>
                                                </th>
                                                <th>&nbsp;{$lang.from}&nbsp;</th>
                                                
                                                <th>&nbsp;{$pages_count}&nbsp;</th>
                                                <th style="padding-left:10px;">{$prev_link}</th>
                                                <th style="padding-left:10px;">{$next_link}</th>
                                                
                                            </tr>
                                            </thead>
                                        </table>
                                    </div>
                                    
                                    
                                </form>
                                </div>
                                <div style="clear:both;"></div>
                                <table border="0" width="100%" cellspacing="1" cellpadding="0" class="dataTable">
                                  <thead>
                                    <tr>
                                      <th>{$lang.title}</th>
                                      <th>{$lang.link_type}</th>
                                      <th width="150">{$lang.table_heading_action}</th>
                                    </tr>
                                  </thead>
                                  <tfoot>
                                    <th colspan="3">
                                      <div style="float:left"> {$lang.total}:&nbsp;{$total_items}&nbsp;{$lang.items}</div>
                                      <div style="float:right">{$lang.table_tip}</div>
                                    </th>
                                  </tfoot>
                                  <tbody>
                                    {foreach from=$menu item=item name=pages}
                                    <tr  class="{if $smarty.foreach.pages.index mod 2 > 0} row1{else} row0{/if}">
                                      <td id="hiden">{$item.link}</td>
                                      <td id="hiden">{$item.id}</td>
                                      <td id="hiden">{$item.url}</td>
                                      <td id="hiden">{$item.sortOrder}</td>
                                      <td width="60%" id="clisk">{$item_icon} &nbsp; {$item.title}</td>
                                      <td>{$item.linkType}</td>
                                      <td align="right">{$set_icon}&nbsp;&nbsp; <a  id="edit" href="#"> {$edit_icon} </a>&nbsp;<a href="#" onclick="trash('{$item.title}', '{$item.trash}');" class='osx'> {$delete_icon}</a>&nbsp;</td>
                                    </tr>
                                    {/foreach}
                                  </tbody>
                                </table>	
                            </div>
                        </form>
                        </fieldset>
                          
                   <fieldset class="step">
                     <form class="valid" name="new_item" action="{$form_action}" method="post">
                        <legend>
                        {$lang.new_item}
                        <img id="{$curLanguage.code}" class="flag selected" src="{$curLanguage.icon}" />
                            {foreach from=$languages item=cur}
                                <img id="{$cur.code}" class="flag" src="{$cur.icon}" />
                            {/foreach}
                        </legend>
                        <div id="formholder">
                             <div id="{$curLanguage.code}" class="selected_container">
                                <p id="lang" class='block'>
                                    <label class='text' for="name">{$lang.title}&nbsp;{$curLanguage.code}<span style="color: red;">*</span></label>
                                    <input class="lang" name="title_{$curLanguage.code}" type="text" validate='text'  />
                                </p>
                            </div>
                            {foreach from=$languages item=cur}
                                <div id="{$cur.code}" class="lang_container" style="display:none;">
                                    <p id="lang" class='block'>
                                        <label class='text' for="name">{$lang.title}&nbsp;{$cur.code}<span style="color: red;">*</span></label>
                                        <input class="lang" name="title_{$cur.code}" type="text" validate='text'  />
                                    </p>
                                </div>
                            {/foreach}
                            
                            <p class='block'>
                                <label class='text' for="country">{$lang.type}<span style="color: red;">*</span></label>
                                <select id="type" name="type">
                                  <option value="inner"> {$lang.inner} </option>
                                  <option value="outer"> {$lang.outer} </option>
                                </select>
                            </p>
                            <p class='block'>
                                <label class='text' for="phone">{$lang.url}<span style="color: red;">*</span></label>
                                <input id="static_link" name="url" value="#" type="text" style="display: none"  />
                                <select id="link_select" name="link">
                                  {foreach from=$pages_keys item=page_key}
                                    <option value="{$page_key}">{$page_key}</option>
                                  {/foreach}
                                </select>
                            </p>
                            <p class='block'>
                                <label class='text' for="website">{$lang.sort_order}<span style="color: red;">*</span></label>
                                <input id="sortOrder" name="sortOrder" type="text" value="1"/>
                            </p>
                           
                        </div>
                        <div id="jump"></div>
                        <div id="formtip">
                            
                            
                            <div id="buttonPlace">
                              <a style="width:150px;" class="large green button" onclick="new_item.submit();" >{$lang.create}</a> 
                              <a style="width:150px;" id="cancel" class="large red button" >{$lang.cancel}</a> 
                            </div>
                            
                            
                        </div>
                        <input name="parent" type="hidden" value="{$parent}" />
                        <input name="create" value="true" type="hidden" />
                    </form> 
           
                    </fieldset>
                    <fieldset class="step" >
                    <form class="valid" name="edit_block" action="{$form_action}" method="post">
                        <legend>
                            {$lang.edit_item}
                            <img id="{$curLanguage.code}" class="flag" src="{$curLanguage.icon}" />
                        </legend>
                        <div id="formholder">
                            
                            
                            <p class='block'>
                                <label class='text' >{$lang.title}</label>
                                <input id="edit_title" name="title" type="text"  />
                            </p>
                            
                            <p class='block'>
                                <label class='text' for="country">{$lang.type}<span style="color: red;">*</span></label>
                                <select id="edit_type" name="type">
                                  <option value="inner"> {$lang.inner} </option>
                                  <option value="outer"> {$lang.outer} </option>
                                </select>
                            </p>
                            <p class='block'>
                                <label class='text' for="phone">{$lang.url}<span style="color: red;">*</span></label>
                                <input  id="edit_static_link" name="url" validate='text' type="text" style="display: none"  />
                                <select id="edit_link_select" name="link">
                                  {foreach from=$pages_keys item=page_key}
                                    <option value="{$page_key}">{$page_key}</option>
                                  {/foreach}
                                </select>
                            </p>
                            <p class='block'>
                                <label class='text' for="website">{$lang.sort_order}<span style="color: red;">*</span></label>
                                <input id="edit_sortOrder" name="sortOrder" type="text" value="1"/>
                            </p>
                            <input name="id"     type="hidden" id="edit_item_id" value="0" />
                            <input name="edit"   type="hidden" value="true"  />
                      
                        </div>
                        <div id="jump"></div>
                        <div id="formtip">
                            
                            
                            
                            
                            <div id="buttonPlace">
                              <a style="width:150px;" class="large green button" onclick="edit_block.submit();" >{$lang.apply}</a> 
                              <a style="width:150px;" id="cancel2" class="large red button" >{$lang.cancel}</a> 
                            </div>
                            
                            
                        </div>
                    </form>    
                    </fieldset>    
                        
        						<fieldset class="step" style="height:325px;">
                      <form>
                        <legend>{$lang.help}</legend>
                                    
          							<p class='block'>
          								Some help
          							</p>
                      </form>
                    </fieldset>
                        
                </div>
                <div id="navigation" style="display:none;">
                    <ul>
                        <li class="selected">
                            <a href="#">{$lang.menu_list}</a>
                        </li>
                        <li>
                           <a href="#">{$lang.new}</a>
                        </li>
                        <li>
                            <a href="#" style="display:none;"></a>
                        </li>
                        <li>
                            <a href="#">{$lang.help}</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        
      </div>
      
      <div id="osx-modal-content">
    	<div id="osx-modal-title">{$lang.conf}</div>
        
    	<div class="close"><a href="#" class="simplemodal-close">x</a></div>
    	<div id="osx-modal-data">
    		<h2>{$lang.menu_item_del_conf} <span id="item"></span>?</h2>
            <div id="blockButtons">
              <a style="width:80px;" id="delete" class="medium green button"  >{$lang.delete}</a> 
              <a style="width:80px;" class="medium red button simplemodal-close" >{$lang.cancel}</a> 
            </div>
    	</div>
    </div> 
  
</div>

    